package com.ml.mall.model.mail.supplier;

import com.ml.mall.model.MailMessage;
import org.springframework.stereotype.Component;

/**
 * @description 该类为卖家提供邮件模板
 * @author pl
 * @date 2021/7/13
 * @version 1.0
*/
@Component
public class MailTemplateForSupplier {


    /**
     * 合伙人发起注册邀请，系统发送 “合伙人发起注册邀请” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getRegistrationInvitationFromPartner(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Airena Procure System Supplier Registration Invitation.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                You are invited to register as <span style=\"color: #54af9a;\">supplier</span> in Airena Procure System!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi, <strong></strong></p>\n" +
                "        <br>\n" +
                "        <p>You are invited to register as a supplier in the Airena Procure System by the system partner <strong>partner_name</strong>!</p>\n" +
                "        <p>Click on the link to complete your registration.</p>\n" +
                "        <a href= sysRegisterUrl style=\"color: #2c84ea; font-weight: bold;\">system_registration_url</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }

    /**
     * 系统发送 “商户成功注册通知” 通用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getRegisterSuccessfulEmail(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Registration success and email verification.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Registration success and email verification <span style=\"color: #54af9a;\"></span>\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>company_name,</strong></p>\n" +
                "        <br>\n" +
                "        <p>You have successfully registered in the Airena Procure System<strong></strong>!</p>\n" +
                "        <a href = emailVerificationUrl style=\"color: #2c84ea; font-weight: bold;\"> email_Verification_Url </a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }

    /**
     * “账号被批准” 公司被批准通用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getAccountApproval(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Account approval for Airena Procure System.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                You are approved as <span style=\"color: #54af9a;\">supplier</span> in Airena Procure System!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>company_name,</strong></p>\n" +
                "        <br>\n" +
                "        <p>Congratulations!</p>\n" +
                "        <p>Your supplier account in Airena Procure System has been approved!</p>\n" +
                "        <p>Please proceed to fill in the necessary details in company profile and upload new products.</p>\n" +
                "        <a href= system_url style=\"color: #2c84ea; font-weight: bold;\"> system_url </a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }

    /**
    卖家订单邮件创建在：com.ml.mall.utils.MailTemplateUtils.MailSupplierTeplate
     */

    /**
     * 低库存量通知，系统发送 “低库存量通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getLowStockNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Product variant is low on stock!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Product variant <span style=\"color: #54af9a;\"> product_variant_name </span> is low on stock!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong> supplier_name,</strong></p>\n" +
                "        <br>\n" +
                "        <p>The product variant <strong> product_variant_name </strong> is currently low on stock. You may increase the amount of the current stock of the product variant once you assure that there are sufficient stock on hold.</p>\n" +
                "        <a href= system_url style=\"color: #2c84ea; font-weight: bold;\"> system_url </a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }

    /**
     * 零库存通知，系统发送 “零库存通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getOutOfStockNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Product variant is out of stock!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Product variant <span style=\"color: #54af9a;\"> product_variant_name </span> is out of stock!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong> supplier_name ,</strong></p>\n" +
                "        <br>\n" +
                "        <p>The product variant <strong> product_variant_name </strong> is currently out of stock. You may increase the amount of the current stock of the product variant once you assure that there are sufficient stock on hold.</p>\n" +
                "        <a href= system_url style=\"color: #2c84ea; font-weight: bold;\"> system_url </a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }

    /**
     * 增加额度通知，系统发送 “增加额度通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getCreditNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Your company has more credit now!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Your company has <span style=\"color: #54af9a;\">more credit</span> now!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong> company_name ,</strong></p>\n" +
                "        <br>\n" +
                "        <p>Your company credit amount has increased to <strong> current_credit </strong> .</p>\n" +
                "        <a href= system_url  style=\"color: #2c84ea; font-weight: bold;\"> system_url </a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong> contact_no </strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }


    /**
     * 暂停公司通知，“暂停公司通知”公用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getCompanySuspended(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Company has been suspended.");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                You company has been <span style=\"color: #f5537f;\">suspended</span>!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>user_name,</strong></p>\n" +
                "        <br>\n" +
                "        <p>Current company <strong> company_name </strong> has been suspended by the Airena Procure System admin. Your account will no longer be able to login to the Airena Procure System.</p>\n" +
                "        <br>\n" +
                "        <p>If there is necessary clarification needed to be done please contact <strong>contact_no</strong> or send email to <strong> general_email </strong> for system enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure System</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>");

        return mailMessage;
    }
}
